package twel.probenprophet.domain.rules.magic.decorators;

import java.math.BigInteger;

import twel.probenprophet.domain.rules.magic.CastableSpell;

public class SpellWithForcedEffect extends SpontaneousModificationDecorator {

	public SpellWithForcedEffect(CastableSpell decorated) {
		super(decorated);
	}

	public SpellWithForcedEffect(CastableSpell decorated, int times) {
		super(decorated, times);
	}

	@Override
	public int getAstralEnergyCost() {
		BigInteger base = BigInteger.valueOf(2);
		int exponent = getTimes() - 1;
		int extraCost = base.pow(exponent).intValue();

		return getDecorated().getAstralEnergyCost() + extraCost;
	}

	@Override
	public int getDifficulty() {
		return getDecorated().getDifficulty() - getTimes();
	}

	@Override
	protected Integer getSpellSkillModifier() {
		return 0;
	}

	@Override
	public int getCastTime() {
		return getTimes() + getDecorated().getCastTime();
	}
}
